package service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import entity.Users;
import mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import service.UserService;
@Service//暴露服务(向zookeeper注册服务)
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;
    @Override
    public int register(Users users) {
        return userMapper.register(users);
    }

    /**
     * 删除用户
     * @param id
     */
    @Override
    public void delete(int id) {
        userMapper.delete(id);
    }

    /**
     * 修改用户
     * @param users
     */
    @Override
    public void update(Users users) {
        userMapper.update(users);
    }

    /**
     * 查询用户
     * @param username
     * @return
     */

    @Override
    public Users findUsersById(String username) {
        return userMapper.findUsersById(username);
    }
}
